package com.zhoukx.flyweight;

/**
 * @ClassName Client
 * @Description:
 * @Author zhoukx
 * @Date 2020/8/10
 **/
public class Client {
    public static void main(String[] args) {
        // 创建一个工厂类
        WebSiteFactory webSiteFactory = new WebSiteFactory();
        // 客户端要以一个新闻形式发布的网站
        User user = new User();
        user.setName("张三");
        WebSite webSite1 = webSiteFactory.getWebSiteCateGory("新闻");
        webSite1.use(user);

        User user1 = new User();
        user1.setName("李四");
        WebSite webSite2 = webSiteFactory.getWebSiteCateGory("博客");
        webSite2.use(user1);

        System.out.println(webSiteFactory.getWebSiteCount());
    }
}
